<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
    <%@ taglib prefix="c"  uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title></title>
<link href="<c:url value='/insdep/reset.min.css' />" rel="stylesheet" type="text/css">
<link href="<c:url value='/insdep/easyui_full.css'/>" rel="stylesheet" type="text/css">
<link href="<c:url value='/insdep/icon.css'/>" rel="stylesheet" type="text/css">
<script type="text/javascript" src="<c:url value='/insdep/jquery-1.11.3.min.js'/>"></script>
<script type="text/javascript" src="<c:url value='/insdep/jquery.easyui-1.5.2.min.js'/>"></script>
<script type="text/javascript" src="<c:url value='/insdep/insdep-extend.min.js'/>"></script>

</head>
<body>
<script type="text/javascript">
function fornatter_state(value, row, index){
	return{
		"1": "在职",
		"0": "离职"
	}[value];
}
function note_bianji(val,row,index){
	if(row.empState==1){
		var add1="";
		add1= '<a class="easyui-linkbutton button-teal iconfont icon-roundadd" style="color:white;padding-left:9%;font-size:14px;padding-right:9%;margin-right:5%" onclick="add1('+index+')">增加</a>';
		return add1;
	}
	
}

</script>
<script type="text/javascript">
		$(function() {
			$(".return1").linkbutton({onClick:function(){
				var center = $("body").layout("panel", "center");
				var url = $(this).attr("id");
				center.panel("refresh",url);
			}})
			/* $(".return").linkbutton({
				onClick : function() {
					var title = "合同管理";
					var url = $(this).attr("id");
					//判断该面板是否已打开
					if($("#tt").tabs("exists", title)){
						//已存在则激活
						$("#tt").tabs("select", title);
					}else{
						//不存在
						var config = {
								title: title,
								href: url,
								closable: true
							}
						$("#tt").tabs("add", config);
					}
				}
			}); */
		})
	</script>

<script type="text/javascript">
$(function(){
	//按条件查询用户
	 $("#queryer").linkbutton({onClick:function(){ 
		 $('#Renew_Contract_from').form('submit', {   
			 	
			    success:function(data){    //表单查询数据刷新DataGrid
			    	var resultData = $.parseJSON(data);  
			    	$('#Renew_Contract_table').datagrid('loadData', resultData); 
			    }    
			}); 
	 }});
	
	 $("#reset_re").linkbutton({
			onClick : function() {
				$("#Renew_Contract_from").form('reset');
			}
		})
	 
})
</script>
<script type="text/javascript">
/**
	 *编辑事件
	 */
	function add1(index){
		$("#RCwin").window({
	 	      	  width: 700,
		          height: 600,
		          title: '增加员工合同信息窗口',
		          iconCls: 'icon-update',
		          modal: true,//表示模式窗口
		          maximizable:false,
		          minimizable:false,
		          collapsible:false,
		          draggable: false ,
				  href:'addRenewContract',//请求远程数据
				});
		$('#Renew_Contract_table').datagrid('selectRow',index);
	 	var row = $('#Renew_Contract_table').datagrid('getSelected');
	 	alert(row.contractId);
	 	var contractId = row.contractId;
		 $.post("checkempAndcontactInfo", {contractId:contractId} ,function(info){
			 $('#add_renew_form').form('load',info);
         });
 	    alert(row);
 	
 }
</script>


<div class="easyui-layout theme-layout" data-options="fit:true">
    <div class="theme-header-layout" style="height:70px;border: 0px solid red" data-options="region:'north'">
    	<div style="margin-left: 3%;width:80%;margin-right:5%;margin-top:20px;border: 0px solid green">
        <form action="RenewContractInfo" id="Renew_Contract_from" class="searcher-form" method="post">
    		<input id="empName" name="empName" class="easyui-textbox"  style="width: 30%;"  labelAlign="right" label="姓名：" labelWidth="150px"> 
			<input id="deptName" name="deptName" class="easyui-textbox"  style="width: 30%;"  labelAlign="right" label="部门：" labelWidth="150px"> 
			<a id="queryer"  class="easyui-linkbutton button-line-blue" 
			style="width: 9%;height: 30px;margin-left: 9%;"><i class="iconfont icon-roundcheck"></i>查询</a>
    		<a id="reset_re"  class="easyui-linkbutton button-line-blue return" 
			style="width: 9%;height: 30px;margin-left: 9%;"><i class="iconfont icon-refresh"></i>重置</a>
    	</form>
    	</div>
    </div>
    <div class="theme-center-layout" style="border: 0px solid red" data-options="region:'center',title:'续签人员信息表'">
        <!-- <div style="margin-left: 12%;margin-right:5%;margin-top:20px;border: 0px solid red"> -->
        <!--  class="table table-striped" -->
        <table id="Renew_Contract_table" style="width:100%;height: 100%" class="easyui-datagrid" 
		data-options="
		height:450,
		url:'RenewContractInfo',
		singleSelect:true,
        collapsible:true,
        method:'get'
		">
	<thead>
		<tr>
			<th style="font-weight: 700;width: 22%" align="center" data-options="field:'empId'">员工编号</th>
			<th style="font-weight: 700;width: 23%" align="center" data-options="field:'deptName'">部门名称</th>
			<th style="font-weight: bold;width: 23%" align="center" data-options="field:'empName'">姓名</th>
			<th style="font-weight: bold;width: 22%" align="center" data-options="field:'empState',formatter:fornatter_state">员工状态</th>
			<!-- <th style="font-weight: bold;width: 18%" align="center" data-options="field:'contractState'">合同状态</th> -->
			<th field="note" style="font-weight: bold;width: 10%;" align="center" data-options="formatter:note_bianji">操作</th>
		</tr>
	</thead>
</table>
<!-- </div> -->

    </div>

</div>
<div id="RCwin"></div>
</body>
</html>